const gchar *icon_name;
GtkIconTheme *icon_theme;
int width;
- GtkIconSize size;
switch (gtk_image_get_storage_type (image))
{
return cairo_surface_reference (gtk_image_get_surface (image));
case GTK_IMAGE_ICON_NAME:
icon_name = gtk_image_get_icon_name (image);
- size = gtk_image_get_icon_size (image);
icon_theme = gtk_icon_theme_get_for_display (gtk_widget_get_display (GTK_WIDGET (image)));
- gtk_icon_size_lookup (size, &width, NULL);
+ gtk_icon_size_lookup (GTK_ICON_SIZE_INHERIT, &width, NULL);
return gtk_icon_theme_load_surface (icon_theme, icon_name, width, 1, NULL, GTK_ICON_LOOKUP_GENERIC_FALLBACK, NULL);
default:
g_warning ("Image storage type %d not handled",
gtk_box_pack_start (GTK_BOX (content_area), hbox);
image = gtk_image_new_from_icon_name ("dialog-question");
+ gtk_image_set_icon_size (GTK_IMAGE (image), GTK_ICON_SIZE_LARGE);
gtk_box_pack_start (GTK_BOX (hbox), image);
table = gtk_grid_new ();
<object class="GtkImage" id="kern_pres">
<property name="visible">1</property>
<property name="icon-name">object-select-symbolic</property>
- <property name="icon-size">1</property>
</object>
</child>
<child>
<object class="GtkImage" id="liga_pres">
<property name="visible">1</property>
<property name="icon-name">object-select-symbolic</property>
- <property name="icon-size">1</property>
</object>
</child>
<child>
<object class="GtkImage" id="dlig_pres">
<property name="visible">1</property>
<property name="icon-name">object-select-symbolic</property>
- <property name="icon-size">1</property>
</object>
</child>
<child>
<object class="GtkImage" id="hlig_pres">
<property name="visible">1</property>
<property name="icon-name">object-select-symbolic</property>
- <property name="icon-size">1</property>
</object>
</child>
<child>
<object class="GtkImage" id="clig_pres">
<property name="visible">1</property>
<property name="icon-name">object-select-symbolic</property>
- <property name="icon-size">1</property>
</object>
</child>
<child>
<object class="GtkImage" id="smcp_pres">
<property name="visible">1</property>
<property name="icon-name">object-select-symbolic</property>
- <property name="icon-size">1</property>
</object>
</child>
<child>
<object class="GtkImage" id="c2sc_pres">
<property name="visible">1</property>
<property name="icon-name">object-select-symbolic</property>
- <property name="icon-size">1</property>
</object>
</child>
<child>
<object class="GtkImage" id="pcap_pres">
<property name="visible">1</property>
<property name="icon-name">object-select-symbolic</property>
- <property name="icon-size">1</property>
</object>
</child>
<child>
<object class="GtkImage" id="c2pc_pres">
<property name="visible">1</property>
<property name="icon-name">object-select-symbolic</property>
- <property name="icon-size">1</property>
</object>
</child>
<child>
<object class="GtkImage" id="unic_pres">
<property name="visible">1</property>
<property name="icon-name">object-select-symbolic</property>
- <property name="icon-size">1</property>
</object>
</child>
<child>
<object class="GtkImage" id="cpsp_pres">
<property name="visible">1</property>
<property name="icon-name">object-select-symbolic</property>
- <property name="icon-size">1</property>
</object>
</child>
<child>
<object class="GtkImage" id="case_pres">
<property name="visible">1</property>
<property name="icon-name">object-select-symbolic</property>
- <property name="icon-size">1</property>
</object>
</child>
<child>
<property name="visible">1</property>
<property name="opacity">0</property>
<property name="icon-name">object-select-symbolic</property>
- <property name="icon-size">1</property>
</object>
</child>
<child>
<object class="GtkImage" id="lnum_pres">
<property name="visible">1</property>
<property name="icon-name">object-select-symbolic</property>
- <property name="icon-size">1</property>
</object>
</child>
<child>
<object class="GtkImage" id="onum_pres">
<property name="visible">1</property>
<property name="icon-name">object-select-symbolic</property>
- <property name="icon-size">1</property>
</object>
</child>
<child>
<property name="visible">1</property>
<property name="opacity">0</property>
<property name="icon-name">object-select-symbolic</property>
- <property name="icon-size">1</property>
</object>
</child>
<child>
<object class="GtkImage" id="pnum_pres">
<property name="visible">1</property>
<property name="icon-name">object-select-symbolic</property>
- <property name="icon-size">1</property>
</object>
</child>
<child>
<object class="GtkImage" id="tnum_pres">
<property name="visible">1</property>
<property name="icon-name">object-select-symbolic</property>
- <property name="icon-size">1</property>
</object>
</child>
<child>
<property name="visible">1</property>
<property name="opacity">0</property>
<property name="icon-name">object-select-symbolic</property>
- <property name="icon-size">1</property>
</object>
</child>
<child>
<object class="GtkImage" id="frac_pres">
<property name="visible">1</property>
<property name="icon-name">object-select-symbolic</property>
- <property name="icon-size">1</property>
</object>
</child>
<child>
<object class="GtkImage" id="afrc_pres">
<property name="visible">1</property>
<property name="icon-name">object-select-symbolic</property>
- <property name="icon-size">1</property>
</object>
</child>
<child>
<object class="GtkImage" id="zero_pres">
<property name="visible">1</property>
<property name="icon-name">object-select-symbolic</property>
- <property name="icon-size">1</property>
</object>
</child>
<child>
<object class="GtkImage" id="nalt_pres">
<property name="visible">1</property>
<property name="icon-name">object-select-symbolic</property>
- <property name="icon-size">1</property>
</object>
</child>
<child>
<object class="GtkImage" id="sinf_pres">
<property name="visible">1</property>
<property name="icon-name">object-select-symbolic</property>
- <property name="icon-size">1</property>
</object>
</child>
<child>
<object class="GtkImage" id="swsh_pres">
<property name="visible">1</property>
<property name="icon-name">object-select-symbolic</property>
- <property name="icon-size">1</property>
</object>
</child>
<child>
<object class="GtkImage" id="cswh_pres">
<property name="visible">1</property>
<property name="icon-name">object-select-symbolic</property>
- <property name="icon-size">1</property>
</object>
</child>
<child>
<object class="GtkImage" id="locl_pres">
<property name="visible">1</property>
<property name="icon-name">object-select-symbolic</property>
- <property name="icon-size">1</property>
</object>
</child>
<child>
<object class="GtkImage" id="calt_pres">
<property name="visible">1</property>
<property name="icon-name">object-select-symbolic</property>
- <property name="icon-size">1</property>
</object>
</child>
<child>
<object class="GtkImage" id="hist_pres">
<property name="visible">1</property>
<property name="icon-name">object-select-symbolic</property>
- <property name="icon-size">1</property>
</object>
</child>
<child>
<object class="GtkImage" id="salt_pres">
<property name="visible">1</property>
<property name="icon-name">object-select-symbolic</property>
- <property name="icon-size">1</property>
</object>
</child>
<child>
<object class="GtkImage" id="titl_pres">
<property name="visible">1</property>
<property name="icon-name">object-select-symbolic</property>
- <property name="icon-size">1</property>
</object>
</child>
<child>
<object class="GtkImage" id="rand_pres">
<property name="visible">1</property>
<property name="icon-name">object-select-symbolic</property>
- <property name="icon-size">1</property>
</object>
</child>
<child>
<object class="GtkImage" id="subs_pres">
<property name="visible">1</property>
<property name="icon-name">object-select-symbolic</property>
- <property name="icon-size">1</property>
</object>
</child>
<child>
<object class="GtkImage" id="sups_pres">
<property name="visible">1</property>
<property name="icon-name">object-select-symbolic</property>
- <property name="icon-size">1</property>
</object>
</child>
<child>
<object class="GtkImage" id="init_pres">
<property name="visible">1</property>
<property name="icon-name">object-select-symbolic</property>
- <property name="icon-size">1</property>
</object>
</child>
<child>
<object class="GtkImage" id="medi_pres">
<property name="visible">1</property>
<property name="icon-name">object-select-symbolic</property>
- <property name="icon-size">1</property>
</object>
</child>
<child>
<object class="GtkImage" id="fina_pres">
<property name="visible">1</property>
<property name="icon-name">object-select-symbolic</property>
- <property name="icon-size">1</property>
</object>
</child>
<child>
<object class="GtkImage" id="isol_pres">
<property name="visible">1</property>
<property name="icon-name">object-select-symbolic</property>
- <property name="icon-size">1</property>
</object>
</child>
<child>
<object class="GtkImage" id="ss01_pres">
<property name="visible">1</property>
<property name="icon-name">object-select-symbolic</property>
- <property name="icon-size">1</property>
</object>
</child>
<child>
<object class="GtkImage" id="ss02_pres">
<property name="visible">1</property>
<property name="icon-name">object-select-symbolic</property>
- <property name="icon-size">1</property>
</object>
</child>
<child>
<object class="GtkImage" id="ss03_pres">
<property name="visible">1</property>
<property name="icon-name">object-select-symbolic</property>
- <property name="icon-size">1</property>
</object>
</child>
<child>
<object class="GtkImage" id="ss04_pres">
<property name="visible">1</property>
<property name="icon-name">object-select-symbolic</property>
- <property name="icon-size">1</property>
</object>
</child>
<child>
<object class="GtkImage" id="ss05_pres">
<property name="visible">1</property>
<property name="icon-name">object-select-symbolic</property>
- <property name="icon-size">1</property>
</object>
</child>
<child>
GtkWidget *new_widget;
if (priv->use_icons)
- new_widget = gtk_image_new_from_icon_name (get_random_icon_name (gtk_icon_theme_get_default ()));
+ {
+ new_widget = gtk_image_new_from_icon_name (get_random_icon_name (gtk_icon_theme_get_default ()));
+ gtk_image_set_icon_size (GTK_IMAGE (new_widget), GTK_ICON_SIZE_LARGE);
+ }
else
new_widget = g_object_new (get_random_widget_type (), NULL);
gtk_box_pack_start (GTK_BOX (vbox), frame);
image = gtk_image_new_from_icon_name ("gtk3-demo");
+ gtk_image_set_icon_size (GTK_IMAGE (image), GTK_ICON_SIZE_LARGE);
gtk_container_add (GTK_CONTAINER (frame), image);
gicon = g_themed_icon_new_with_default_fallbacks ("battery-caution-charging-symbolic");
image = gtk_image_new_from_gicon (gicon);
+ gtk_image_set_icon_size (GTK_IMAGE (image), GTK_ICON_SIZE_LARGE);
gtk_container_add (GTK_CONTAINER (frame), image);
gtk_button_set_label (GTK_BUTTON (priv->resent_by_button), priv->message->resent_by);
if (strcmp (priv->message->sender_nick, "@GTKtoolkit") == 0)
- gtk_image_set_from_icon_name (priv->avatar_image, "gtk3-demo");
+ {
+ gtk_image_set_from_icon_name (priv->avatar_image, "gtk3-demo");
+ gtk_image_set_icon_size (priv->avatar_image, GTK_ICON_SIZE_LARGE);
+ }
else
gtk_image_set_from_pixbuf (priv->avatar_image, avatar_pixbuf_other);
<object class="GtkImage">
<property name="visible">1</property>
<property name="icon-name">face-cool-symbolic</property>
- <property name="icon-size">6</property>
+ <property name="icon-size">large</property>
</object>
</child>
</object>
<object class="GtkImage">
<property name="visible">1</property>
<property name="icon-name">face-cool-symbolic</property>
- <property name="icon-size">6</property>
+ <property name="icon-size">large</property>
</object>
</child>
</object>
<object class="GtkImage">
<property name="visible">1</property>
<property name="icon-name">face-cool-symbolic</property>
- <property name="icon-size">6</property>
+ <property name="icon-size">large</property>
</object>
</child>
</object>
<object class="GtkImage">
<property name="visible">1</property>
<property name="icon-name">face-cool-symbolic</property>
- <property name="icon-size">6</property>
+ <property name="icon-size">large</property>
</object>
</child>
</object>
<object class="GtkImage">
<property name="visible">1</property>
<property name="icon-name">face-cool-symbolic</property>
- <property name="icon-size">6</property>
+ <property name="icon-size">large</property>
</object>
</child>
</object>
<object class="GtkImage">
<property name="visible">1</property>
<property name="icon-name">face-cool-symbolic</property>
- <property name="icon-size">6</property>
+ <property name="icon-size">large</property>
</object>
</child>
</object>
<object class="GtkImage">
<property name="visible">1</property>
<property name="icon-name">face-cool-symbolic</property>
- <property name="icon-size">6</property>
+ <property name="icon-size">large</property>
</object>
</child>
</object>
<object class="GtkImage">
<property name="visible">1</property>
<property name="icon-name">face-cool-symbolic</property>
- <property name="icon-size">6</property>
+ <property name="icon-size">large</property>
</object>
</child>
</object>
<object class="GtkImage">
<property name="visible">1</property>
<property name="icon-name">face-cool-symbolic</property>
- <property name="icon-size">6</property>
+ <property name="icon-size">large</property>
</object>
</child>
</object>
icon_name = gtk_tool_button_get_icon_name (button);
icon_theme = gtk_icon_theme_get_for_display (gtk_widget_get_display (widget));
- gtk_icon_size_lookup (GTK_ICON_SIZE_DIALOG, &width, NULL);
+ gtk_icon_size_lookup (GTK_ICON_SIZE_LARGE, &width, NULL);
pixbuf = gtk_icon_theme_load_icon (icon_theme,
icon_name,
width,
<object class="GtkImage" id="search-icon">
<property name="visible">True</property>
<property name="icon-name">edit-find-symbolic</property>
- <property name="icon-size">1</property>
</object>
</child>
</object>
<child>
<object class="GtkImage" id="listboxrow3image">
<property name="icon-name">object-select-symbolic</property>
- <property name="icon-size">1</property>
<property name="halign">end</property>
<property name="valign">center</property>
<property name="margin-top">6</property>
<child>
<object class="GtkImage">
<property name="icon-name">object-select-symbolic</property>
- <property name="icon-size">1</property>
<property name="halign">end</property>
<property name="valign">center</property>
<property name="margin-top">6</property>
widget = gtk_menu_button_new ();
image = gtk_image_new ();
- gtk_image_set_from_icon_name (GTK_IMAGE (image), "emblem-system-symbolic", GTK_ICON_SIZE_MENU);
+ gtk_image_set_from_icon_name (GTK_IMAGE (image), "emblem-system-symbolic");
gtk_container_add (GTK_CONTAINER (widget), image);
menu = gtk_menu_new ();
gtk_menu_button_set_popup (GTK_MENU_BUTTON (widget), menu);
GtkWidget *widget;
GtkWidget *vbox;
- widget = gtk_image_new_from_icon_name ("applications-graphics",
- GTK_ICON_SIZE_DIALOG);
+ widget = gtk_image_new_from_icon_name ("applications-graphics");
+ gtk_image_set_icon_size (GTK_IMAGE (widget), GTK_ICON_SIZE_LARGE);
gtk_widget_set_halign (widget, GTK_ALIGN_CENTER);
gtk_widget_set_valign (widget, GTK_ALIGN_CENTER);
<object class="GtkImage" id="search-icon">
<property name="visible">True</property>
<property name="icon-name">edit-find-symbolic</property>
- <property name="icon-size">1</property>
</object>
</child>
</object>
<object class="GtkImage" id="search-icon">
<property name="visible">True</property>
<property name="icon-name">edit-find-symbolic</property>
- <property name="icon-size">1</property>
</object>
</child>
</object>
<object class="GtkImage" id="search-icon">
<property name="visible">True</property>
<property name="icon-name">edit-find-symbolic</property>
- <property name="icon-size">1</property>
</object>
</child>
</object>
<object class="GtkImage" id="search-icon">
<property name="visible">True</property>
<property name="icon-name">edit-find-symbolic</property>
- <property name="icon-size">1</property>
</object>
</child>
</object>
priv = cellpixbuf->priv;
priv->image_def = gtk_image_definition_new_empty ();
- priv->icon_size = GTK_ICON_SIZE_MENU;
+ priv->icon_size = GTK_ICON_SIZE_INHERIT;
}
static void
P_("The GtkIconSize value that specifies the size of the rendered icon"),
0,
G_MAXUINT,
- GTK_ICON_SIZE_MENU,
+ GTK_ICON_SIZE_INHERIT,
GTK_PARAM_READWRITE));
/**
g_param_spec_enum ("size",
P_("Size"),
P_("The GtkIconSize value that specifies the size of the rendered spinner"),
- GTK_TYPE_ICON_SIZE, GTK_ICON_SIZE_MENU,
+ GTK_TYPE_ICON_SIZE, GTK_ICON_SIZE_INHERIT,
G_PARAM_READWRITE|G_PARAM_EXPLICIT_NOTIFY));
}
{
cell->priv = gtk_cell_renderer_spinner_get_instance_private (cell);
cell->priv->pulse = 0;
- cell->priv->icon_size = GTK_ICON_SIZE_MENU;
+ cell->priv->icon_size = GTK_ICON_SIZE_INHERIT;
}
/**
/**
* GtkIconSize:
- * @GTK_ICON_SIZE_INVALID: Invalid size.
- * @GTK_ICON_SIZE_MENU: Size appropriate for menus (16px).
- * @GTK_ICON_SIZE_SMALL_TOOLBAR: Size appropriate for small toolbars (16px).
- * @GTK_ICON_SIZE_LARGE_TOOLBAR: Size appropriate for large toolbars (24px)
- * @GTK_ICON_SIZE_BUTTON: Size appropriate for buttons (16px)
- * @GTK_ICON_SIZE_DND: Size appropriate for drag and drop (32px)
- * @GTK_ICON_SIZE_DIALOG: Size appropriate for dialogs (48px)
+ * @GTK_ICON_SIZE_INHERIT: Keep the size of the parent element
+ * @GTK_ICON_SIZE_NORMAL: Size similar to text size
+ * @GTK_ICON_SIZE_LARGE: Large size, for example in an icon view
*
- * Built-in stock icon sizes.
+ * Built-in icon sizes.
+ *
+ * Icon sizes default to being inherited. Where they cannot be
+ * inherited, text size is the default.
*/
typedef enum
{
- GTK_ICON_SIZE_INVALID,
- GTK_ICON_SIZE_MENU,
- GTK_ICON_SIZE_SMALL_TOOLBAR,
- GTK_ICON_SIZE_LARGE_TOOLBAR,
- GTK_ICON_SIZE_BUTTON,
- GTK_ICON_SIZE_DND,
- GTK_ICON_SIZE_DIALOG
+ GTK_ICON_SIZE_INHERIT,
+ GTK_ICON_SIZE_NORMAL,
+ GTK_ICON_SIZE_LARGE
} GtkIconSize;
/**
memset (self, 0, sizeof (GtkIconHelper));
self->def = gtk_image_definition_new_empty ();
+ self->icon_size = GTK_ICON_SIZE_INHERIT;
self->pixel_size = -1;
self->texture_is_symbolic = FALSE;
}
else if (!gtk_icon_size_lookup (self->icon_size, &width, &height))
{
- if (self->icon_size == GTK_ICON_SIZE_INVALID)
+ if (self->icon_size == GTK_ICON_SIZE_INHERIT)
{
width = height = 0;
}
width = (gdk_texture_get_width (self->texture) + self->texture_scale - 1) / self->texture_scale;
height = (gdk_texture_get_height (self->texture) + self->texture_scale - 1) / self->texture_scale;
}
- else if (self->icon_size != GTK_ICON_SIZE_INVALID)
+ else if (self->icon_size != GTK_ICON_SIZE_INHERIT)
{
ensure_icon_size (self, &width, &height);
}
struct _IconSize
{
- const char *name;
-
int width;
int height;
};
static const IconSize icon_sizes[] = {
- [GTK_ICON_SIZE_INVALID] = {
- .name = NULL,
- .width = 0,
- .height = 0,
- },
- [GTK_ICON_SIZE_MENU] = {
- .name = "gtk-menu",
- .width = 16,
- .height = 16,
- },
- [GTK_ICON_SIZE_BUTTON] = {
- .name = "gtk-button",
+ [GTK_ICON_SIZE_INHERIT] = {
.width = 16,
.height = 16,
},
- [GTK_ICON_SIZE_SMALL_TOOLBAR] = {
- .name = "gtk-small-toolbar",
+ [GTK_ICON_SIZE_NORMAL] = {
.width = 16,
.height = 16,
},
- [GTK_ICON_SIZE_LARGE_TOOLBAR] = {
- .name = "gtk-large-toolbar",
- .width = 24,
- .height = 24,
- },
- [GTK_ICON_SIZE_DND] = {
- .name = "gtk-dnd",
+ [GTK_ICON_SIZE_LARGE] = {
.width = 32,
.height = 32,
},
- [GTK_ICON_SIZE_DIALOG] = {
- .name = "gtk-dialog",
- .width = 48,
- .height = 48,
- },
};
/**
* @height: (out) (optional): location to store icon height
*
* Obtains the pixel size of a semantic icon size @size:
- * #GTK_ICON_SIZE_MENU, #GTK_ICON_SIZE_BUTTON, etc. This function
+ * #GTK_ICON_NORMAL, #GTK_ICON_SIZE_LARGE, etc. This function
* isn’t normally needed, gtk_icon_theme_load_icon() is the usual
* way to get an icon for rendering, then just look at the size of
* the rendered pixbuf. The rendered pixbuf may not even correspond to
if (size >= G_N_ELEMENTS (icon_sizes))
return FALSE;
- if (size == GTK_ICON_SIZE_INVALID)
- return FALSE;
-
if (widthp)
*widthp = icon_sizes[size].width;
};
-#define DEFAULT_ICON_SIZE GTK_ICON_SIZE_BUTTON
+#define DEFAULT_ICON_SIZE GTK_ICON_SIZE_INHERIT
static void gtk_image_snapshot (GtkWidget *widget,
GtkSnapshot *snapshot);
static void gtk_image_size_allocate (GtkWidget *widget,
{
GtkImagePrivate *priv = gtk_image_get_instance_private (image);
- g_return_val_if_fail (GTK_IS_IMAGE (image), GTK_ICON_SIZE_INVALID);
+ g_return_val_if_fail (GTK_IS_IMAGE (image), GTK_ICON_SIZE_INHERIT);
return _gtk_icon_helper_get_icon_size (&priv->icon_helper);
}
gtk_box_pack_start (GTK_BOX (content_area), hbox);
icon = gtk_image_new_from_icon_name ("dialog-password");
+ gtk_image_set_icon_size (GTK_IMAGE (icon), GTK_ICON_SIZE_LARGE);
gtk_widget_set_halign (icon, GTK_ALIGN_CENTER);
gtk_widget_set_valign (icon, GTK_ALIGN_START);
/* Left */
icon = gtk_image_new_from_icon_name ("dialog-password-symbolic");
+ gtk_image_set_icon_size (GTK_IMAGE (icon), GTK_ICON_SIZE_LARGE);
gtk_widget_set_halign (icon, GTK_ALIGN_CENTER);
gtk_widget_set_valign (icon, GTK_ALIGN_START);
g_object_set (icon, "margin", 12, NULL);
GTK_WIDGET_CLASS (gtk_print_unix_dialog_parent_class)->style_updated (widget);
- gtk_icon_size_lookup (GTK_ICON_SIZE_DIALOG, &size, NULL);
+ gtk_icon_size_lookup (GTK_ICON_SIZE_LARGE, &size, NULL);
scale = size / 48.0;
gtk_drawing_area_set_content_width (GTK_DRAWING_AREA (priv->collate_image), (50 + 20) * scale);
gulong manager_changed_id;
guint local_manager : 1;
- gint icon_size;
-
/* RecentChooser properties */
gint limit;
GtkRecentSortType sort_type;
priv->select_multiple = FALSE;
priv->local_only = TRUE;
- priv->icon_size = FALLBACK_ICON_SIZE;
priv->icon_theme = NULL;
priv->current_filter = NULL;
if (!impl->priv->icon_theme)
impl->priv->icon_theme = get_icon_theme_for_widget (widget);
- impl->priv->icon_size = get_icon_size_for_widget (widget,
- GTK_ICON_SIZE_BUTTON);
-
if (!impl->priv->limit_set)
impl->priv->limit = DEFAULT_RECENT_FILES_LIMIT;
/* Size based on characters and the icon size */
gtk_style_context_get (context, "font-size", &font_size, NULL);
- width = impl->priv->icon_size + font_size * NUM_CHARS + 0.5;
- height = (impl->priv->icon_size + font_size) * NUM_LINES + 0.5;
+ width = 16 + font_size * NUM_CHARS + 0.5;
+ height = (16 + font_size) * NUM_LINES + 0.5;
/* Use at least the requisition size... */
gtk_widget_get_preferred_size (widget, &req, NULL);
g_assert (GTK_IS_RECENT_CHOOSER_DEFAULT (impl));
- size = get_icon_size_for_widget (GTK_WIDGET (impl), GTK_ICON_SIZE_DND);
+ size = get_icon_size_for_widget (GTK_WIDGET (impl), GTK_ICON_SIZE_NORMAL);
info = gtk_recent_chooser_get_current_item (GTK_RECENT_CHOOSER (impl));
if (!info)
return NULL;
priv = gtk_stack_switcher_get_instance_private (switcher);
- priv->icon_size = GTK_ICON_SIZE_MENU;
+ priv->icon_size = GTK_ICON_SIZE_INHERIT;
priv->stack = NULL;
priv->buttons = g_hash_table_new (g_direct_hash, g_direct_equal);
P_("Icon Size"),
P_("Symbolic size to use for named icon"),
0, G_MAXINT,
- GTK_ICON_SIZE_MENU,
+ GTK_ICON_SIZE_INHERIT,
G_PARAM_EXPLICIT_NOTIFY | GTK_PARAM_READWRITE));
g_object_class_install_property (object_class,
if (button->priv->icon_widget)
{
icon = button->priv->icon_widget;
-
- if (GTK_IS_IMAGE (icon))
- {
- g_object_set (button->priv->icon_widget,
- "icon-size", GTK_ICON_SIZE_SMALL_TOOLBAR,
- NULL);
- }
}
else if (button->priv->icon_name)
{
{
gint width, height;
- if (gtk_icon_size_lookup (GTK_ICON_SIZE_MENU, &width, &height))
+ if (gtk_icon_size_lookup (GTK_ICON_SIZE_NORMAL, &width, &height))
{
cairo_surface_t *src_surface, *dest_surface;
GtkWidget *cloned_image;
<property name="halign">end</property>
<property name="valign">baseline</property>
<property name="icon-name">object-select-symbolic</property>
- <property name="icon-size">1</property>
<property name="hexpand">1</property>
</object>
</child>
<property name="halign">end</property>
<property name="valign">baseline</property>
<property name="icon-name">object-select-symbolic</property>
- <property name="icon-size">1</property>
<property name="hexpand">1</property>
</object>
</child>
<property name="halign">end</property>
<property name="valign">baseline</property>
<property name="icon-name">object-select-symbolic</property>
- <property name="icon-size">1</property>
</object>
</child>
</object>
<property name="visible">true</property>
<property name="halign">end</property>
<property name="valign">baseline</property>
- <property name="icon-size">1</property>
<property name="icon-name">object-select-symbolic</property>
</object>
</child>
<property name="visible">true</property>
<property name="halign">end</property>
<property name="valign">baseline</property>
- <property name="icon-size">1</property>
<property name="icon-name">object-select-symbolic</property>
</object>
</child>
<property name="visible">true</property>
<property name="halign">end</property>
<property name="valign">baseline</property>
- <property name="icon-size">1</property>
<property name="icon-name">object-select-symbolic</property>
</object>
</child>
<property name="visible">true</property>
<property name="halign">end</property>
<property name="valign">baseline</property>
- <property name="icon-size">1</property>
<property name="icon-name">object-select-symbolic</property>
</object>
</child>
<object class="GtkImage" id="image1">
<property name="visible">1</property>
<property name="icon-name">gtk-orientation-portrait</property>
- <property name="icon-size">3</property>
</object>
</child>
<child>
<object class="GtkImage" id="image2">
<property name="visible">1</property>
<property name="icon-name">gtk-orientation-reverse-portrait</property>
- <property name="icon-size">3</property>
</object>
</child>
<child>
<object class="GtkImage" id="image3">
<property name="visible">1</property>
<property name="icon-name">gtk-orientation-landscape</property>
- <property name="icon-size">3</property>
</object>
</child>
<child>
<object class="GtkImage" id="image4">
<property name="visible">1</property>
<property name="icon-name">gtk-orientation-reverse-landscape</property>
- <property name="icon-size">3</property>
</object>
</child>
<child>
<child>
<object class="GtkImage">
<property name="icon-name">pan-end-symbolic</property>
- <property name="icon-size">1</property>
</object>
</child>
<style>
<child>
<object class="GtkImage">
<property name="icon-name">pan-start-symbolic</property>
- <property name="icon-size">1</property>
</object>
</child>
<style>
<object class="GtkImage" id="eject_icon">
<property name="visible">1</property>
<property name="icon-name">media-eject-symbolic</property>
- <property name="icon-size">1</property>
</object>
</child>
<style>
<object class="GtkImage" id="image1">
<property name="visible">1</property>
<property name="icon-name">dialog-warning-symbolic</property>
- <property name="icon-size">1</property>
</object>
</child>
<child>
</style>
<child>
<object class="GtkImage" id="close_image">
- <property name="icon-size">1</property>
<property name="icon-name">window-close-symbolic</property>
</object>
</child>
<child>
<object class="GtkImage" id="back_icon">
<property name="visible">True</property>
- <property name="icon_size">1</property>
</object>
</child>
</object>
<object class="GtkImage">
<property name="visible">True</property>
<property name="icon-name">emblem-system-symbolic</property>
- <property name="icon-size">1</property>
</object>
</child>
</object>
<object class="GtkImage">
<property name="visible">True</property>
<property name="icon-name">pan-down-symbolic</property>
- <property name="icon-size">1</property>
</object>
</child>
</object>
<object class="GtkImage">
<property name="visible">True</property>
<property name="icon-name">object-select-symbolic</property>
- <property name="icon-size">1</property>
</object>
</child>
</object>
const char *icon_name;
int width;
cairo_surface_t *surface;
- GtkIconSize size;
switch (gtk_image_get_storage_type (image))
{
return cairo_surface_reference (surface);
case GTK_IMAGE_ICON_NAME:
icon_name = gtk_image_get_icon_name (image);
- size = gtk_image_get_icon_size (image);
icon_theme = gtk_icon_theme_get_for_display (gtk_widget_get_display (GTK_WIDGET (image)));
- gtk_icon_size_lookup (size, &width, NULL);
+ gtk_icon_size_lookup (GTK_ICON_SIZE_LARGE, &width, NULL);
*out_size = width;
return gtk_icon_theme_load_surface (icon_theme, icon_name, width, 1, NULL, GTK_ICON_LOOKUP_GENERIC_FALLBACK, NULL);
default:
GtkWidget *image;
image = gtk_image_new_from_icon_name (icon_name);
+ gtk_image_set_icon_size (GTK_IMAGE (image), GTK_ICON_SIZE_LARGE);
gtk_drag_source_set (image, GDK_BUTTON1_MASK, NULL, GDK_ACTION_COPY);
update_source_target_list (image);
GtkWidget *image;
image = gtk_image_new_from_icon_name (icon_name);
+ gtk_image_set_icon_size (GTK_IMAGE (image), GTK_ICON_SIZE_LARGE);
gtk_drag_source_set (image, GDK_BUTTON1_MASK, NULL, GDK_ACTION_COPY);
update_source_target_list (image);
gtk_widget_set_hexpand (widget, TRUE);
image = gtk_image_new_from_icon_name ("face-wink");
+ gtk_image_set_icon_size (GTK_IMAGE (image), GTK_ICON_SIZE_LARGE);
gtk_widget_set_hexpand (image, TRUE);
gtk_image_set_pixel_size (GTK_IMAGE (image), 256);
gtk_box_pack_start (GTK_BOX (hbox), vbox);
image = gtk_image_new_from_gicon (G_ICON (pixbuf));
+ gtk_image_set_icon_size (GTK_IMAGE (image), GTK_ICON_SIZE_LARGE);
gtk_box_pack_start (GTK_BOX (vbox), image);
label = gtk_label_new (NULL);
gtk_box_pack_start (GTK_BOX (hbox), vbox);
image2 = gtk_image_new_from_gicon (emblemed);
+ gtk_image_set_icon_size (GTK_IMAGE (image2), GTK_ICON_SIZE_LARGE);
gtk_box_pack_start (GTK_BOX (vbox), image2);
label = gtk_label_new (NULL);
label = gtk_label_new ("GTK_IMAGE_ICON_NAME");
gtk_grid_attach (GTK_GRID (grid), label, 0, 4, 1, 1);
image = gtk_image_new_from_icon_name (icon_name);
+ gtk_image_set_icon_size (GTK_IMAGE (image), GTK_ICON_SIZE_LARGE);
gtk_grid_attach (GTK_GRID (grid), image, 1, 4, 1, 1);
image = gtk_image_new_from_icon_name (icon_name);
+ gtk_image_set_icon_size (GTK_IMAGE (image), GTK_ICON_SIZE_LARGE);
gtk_image_set_pixel_size (GTK_IMAGE (image), 30);
gtk_grid_attach (GTK_GRID (grid), image, 2, 4, 1, 1);
gtk_grid_attach (GTK_GRID (grid), label, 0, 5, 1, 1);
icon = g_themed_icon_new_with_default_fallbacks ("folder-remote");
image = gtk_image_new_from_gicon (icon);
+ gtk_image_set_icon_size (GTK_IMAGE (image), GTK_ICON_SIZE_LARGE);
g_object_unref (icon);
gtk_grid_attach (GTK_GRID (grid), image, 1, 5, 1, 1);
file = g_file_new_for_path ("apple-red.png");
icon = g_file_icon_new (file);
image = gtk_image_new_from_gicon (icon);
+ gtk_image_set_icon_size (GTK_IMAGE (image), GTK_ICON_SIZE_LARGE);
g_object_unref (icon);
gtk_image_set_pixel_size (GTK_IMAGE (image), 30);
gtk_grid_attach (GTK_GRID (grid), image, 2, 5, 1, 1);
GdkDragContext *context,
gpointer data)
{
- cairo_surface_t *surface;
guint page_num;
page_num = gtk_notebook_get_current_page (GTK_NOTEBOOK (widget));
if (page_num > 2)
- {
- GtkIconTheme *icon_theme;
- int width;
-
- icon_theme = gtk_icon_theme_get_for_display (gtk_widget_get_display (widget));
- gtk_icon_size_lookup (GTK_ICON_SIZE_DND, &width, NULL);
- surface = gtk_icon_theme_load_surface (icon_theme,
- (page_num % 2) ? "help-browser" : "process-stop",
- width,
- 1, NULL,
- GTK_ICON_LOOKUP_GENERIC_FALLBACK,
- NULL);
-
- gtk_drag_set_icon_surface (context, surface);
- cairo_surface_destroy (surface);
- }
+ gtk_drag_set_icon_name (context,
+ (page_num % 2) ? "help-browser" : "process-stop",
+ 0, 0);
}
static gboolean
gtk_toolbar_insert (GTK_TOOLBAR (toolbar), item, -1);
image = gtk_image_new_from_icon_name ("dialog-warning");
+ gtk_image_set_icon_size (GTK_IMAGE (image), GTK_ICON_SIZE_LARGE);
item = gtk_tool_item_new ();
gtk_widget_show (image);
gtk_container_add (GTK_CONTAINER (item), image);
column = gtk_tree_view_column_new ();
renderer = gtk_cell_renderer_pixbuf_new ();
- g_object_set (renderer, "stock-size", GTK_ICON_SIZE_DIALOG, NULL);
+ g_object_set (renderer, "stock-size", GTK_ICON_SIZE_LARGE, NULL);
gtk_tree_view_column_pack_start (column, renderer, TRUE);
gtk_tree_view_column_set_attributes (column, renderer,
"icon-name", ICON_COLUMN, NULL);
<object class="GtkImage" id="camera_icon">
<property name="visible">True</property>
<property name="icon_name">camera-web-symbolic</property>
- <property name="icon_size">1</property>
</object>
</child>
</object>
<object class="GtkImage" id="volume_icon">
<property name="visible">True</property>
<property name="icon_name">audio-volume-medium-symbolic</property>
- <property name="icon_size">1</property>
</object>
</child>
</object>
<object class="GtkImage" id="microphone_icon">
<property name="visible">True</property>
<property name="icon_name">audio-input-microphone-symbolic</property>
- <property name="icon_size">1</property>
</object>
</child>
</object>
<object class="GtkImage" id="bt_icon">
<property name="visible">True</property>
<property name="icon_name">bluetooth-active-symbolic</property>
- <property name="icon_size">1</property>
</object>
</child>
</object>
<object class="GtkImage" id="opt_icon">
<property name="visible">True</property>
<property name="icon_name">media-optical-symbolic</property>
- <property name="icon_size">1</property>
</object>
</child>
</object>
<object class="GtkImage" id="hdd_icon">
<property name="visible">True</property>
<property name="icon_name">drive-harddisk-symbolic</property>
- <property name="icon_size">1</property>
</object>
</child>
</object>
<object class="GtkImage" id="joy_icon">
<property name="visible">True</property>
<property name="icon_name">input-gaming-symbolic</property>
- <property name="icon_size">1</property>
</object>
</child>
</object>
<property name="halign">center</property>
<property name="valign">start</property>
<property name="margin_top">24</property>
- <property name="icon_size">1</property>
<style>
<class name="osd"/>
</style>
<property name="can_focus">False</property>
<property name="pixel_size">100</property>
<property name="icon_name">pan-down-symbolic</property>
- <property name="icon_size">0</property>
</object>
</child>
</object>
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="icon_name">pan-down-symbolic</property>
- <property name="icon_size">1</property>
<property name="halign">center</property>
<property name="valign">center</property>
</object>
<property name="can_focus">False</property>
<property name="halign">center</property>
<property name="valign">center</property>
- <property name="icon-size">0</property>
<property name="width-request">0</property>
<property name="height-request">0</property>
</object>
<property name="can_focus">False</property>
<property name="halign">center</property>
<property name="valign">center</property>
- <property name="icon-size">0</property>
<property name="width-request">0</property>
<property name="height-request">0</property>
</object>
<property name="can_focus">False</property>
<property name="halign">center</property>
<property name="valign">center</property>
- <property name="icon-size">0</property>
<property name="width-request">0</property>
<property name="height-request">0</property>
</object>